package cn.springBoot.delegate;

import org.camunda.bpm.engine.delegate.DelegateExecution;
import org.camunda.bpm.engine.delegate.JavaDelegate;

import java.util.ArrayList;
import java.util.List;

/**
 * @author ljx
 * @description:  java class 系统任务
 * @class cn.springBoot.Delegate.AuditDelegate
 * @create date: 2021/9/13
 */
public class AuditDelegate  implements JavaDelegate {

    @Override
    public void execute(DelegateExecution execution) throws Exception {
        System.out.println("javacalss - SERVICE TASK - 回调");

        System.out.println("通知客服、采购执行、销售、供应链部门");
        String message = (String) execution.getVariable("message");
        System.out.println("message:"+message);


        //添加会签人员
        System.out.println("%%%%%%%%%%%%%%%添加会签人员%%%%%%%%%%%%%%%%%%%");
        List<String> userList = new ArrayList<>();
        userList.add("user1");
        userList.add("user2");
        userList.add("user3");
        execution.setVariable("assigneeList", userList);
        System.out.println("%%%%%%%%%%%%%%%添加结束%%%%%%%%%%%%%%%%%%%");
    }
}
